Skip to content

Get extra intrinsic gas for custom fee currency in e2e#335

Merged
Kourin1996 merged 9 commits intocelo-rebase-12from
Kourin1996/get-fee-currency-intrinstic-gas-in-e2e
Feb 24, 2025
Merged

Get extra intrinsic gas for custom fee currency in e2e#335
Kourin1996 merged 9 commits intocelo-rebase-12from
Kourin1996/get-fee-currency-intrinstic-gas-in-e2e

Conversation

@Kourin1996
Copy link
Copy Markdown

Closes #260

This PR adds obtaining extra IntrinsicGas cost for custom fee currency from smart contract in order to avoid failure of e2e tests due to change of its cost.

@Kourin1996 Kourin1996 self-assigned this Feb 17, 2025
@Kourin1996 Kourin1996 changed the title Get IntrinsicGas for custom fee currency in e2e Get extra intrinsic gas for custom fee currency in e2e Feb 17, 2025
@Kourin1996 Kourin1996 marked this pull request as ready for review February 17, 2025 11:05
@Kourin1996 Kourin1996 requested a review from piersy February 17, 2025 11:05
@Kourin1996 Kourin1996 marked this pull request as draft February 17, 2025 11:33
@Kourin1996 Kourin1996 marked this pull request as ready for review February 17, 2025 14:47
@palango palango requested a review from ezdac February 20, 2025 12:20
Copy link
Copy Markdown

@ezdac ezdac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, apart from 2 small nit-picks.

to: "0x00000000000000000000000000000000DeaDBeef",
value: 2,
gas: 171000,
gas: await getIntrinsicGasForFeeCurrency(21000, firstCurrency),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the value-only intrinsic gas could be defined as a test-wide constant and referenced everywhere


// getIntrinsicGasForFeeCurrency calculates intrinsic gas by adding extra intrinsic gas to the base intrinsic gas and additional cost
async function getIntrinsicGasForFeeCurrency(baseIntrinsicGas, feeCurrency) {
if (!feeCurrency) return baseIntrinsicGas
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the other code-path always returns a BigInt, I would also cast to BigInt here.

@Kourin1996 Kourin1996 merged commit 9e9144c into celo-rebase-12 Feb 24, 2025
8 checks passed
@Kourin1996 Kourin1996 deleted the Kourin1996/get-fee-currency-intrinstic-gas-in-e2e branch February 24, 2025 10:15
piersy pushed a commit that referenced this pull request Apr 8, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 9, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 9, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 9, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 9, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 11, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 11, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 11, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 11, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 11, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request Apr 11, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 1, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 2, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 6, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 6, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 6, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 6, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 8, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 12, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 22, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
piersy pushed a commit that referenced this pull request May 22, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 20, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 21, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 26, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 28, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 30, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 30, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 30, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 31, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 31, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Jul 31, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Aug 1, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Aug 1, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Aug 1, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 added a commit that referenced this pull request Aug 3, 2025
* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 pushed a commit that referenced this pull request Aug 4, 2025
…m test (#43, #55, #293)

Co-authored-by: Pastoh <hbandura@users.noreply.github.com>
Co-authored-by: kourin <yoshiki.takabayashi@clabs.co>

e2e(js): Loosen error check condition in e2e-test (#380)

Due to possible expansion of the responses error string in potential
proxy setups on a live RPC endpoint, the strict error check in the e2e
viem test caused the test to fail, although the error condition was
expected.

e2e(js): Add test of sending CIP-64 tx with unregistered fee currency in viem e2e test

e2e(js): Run e2e tests on alfajores (#212, #258, #268, #293)

Adds a test of transactions that exceed the max intrinsic gas for a fee
currency, this checks that the transaction fails and the fee currency is
blocked.

This entailed increasing gas limits
for a number of transactions that interact with fee currencies, since
the fee currencies on alfajores are different to our debug ones and also
tests needed to be updated to not rely on hardcoded fee currency rates.

Co-authored-by: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com>

e2e(js): Get extra intrinsic gas for custom fee currency in e2e (#335)

* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 pushed a commit that referenced this pull request Aug 4, 2025
…m test (#43, #55, #293)

Co-authored-by: Pastoh <hbandura@users.noreply.github.com>
Co-authored-by: kourin <yoshiki.takabayashi@clabs.co>

e2e(js): Loosen error check condition in e2e-test (#380)

Due to possible expansion of the responses error string in potential
proxy setups on a live RPC endpoint, the strict error check in the e2e
viem test caused the test to fail, although the error condition was
expected.

e2e(js): Add test of sending CIP-64 tx with unregistered fee currency in viem e2e test

e2e(js): Run e2e tests on alfajores (#212, #258, #268, #293)

Adds a test of transactions that exceed the max intrinsic gas for a fee
currency, this checks that the transaction fails and the fee currency is
blocked.

This entailed increasing gas limits
for a number of transactions that interact with fee currencies, since
the fee currencies on alfajores are different to our debug ones and also
tests needed to be updated to not rely on hardcoded fee currency rates.

Co-authored-by: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com>

e2e(js): Get extra intrinsic gas for custom fee currency in e2e (#335)

* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 pushed a commit that referenced this pull request Aug 4, 2025
…m test (#43, #55, #293)

Co-authored-by: Pastoh <hbandura@users.noreply.github.com>
Co-authored-by: kourin <yoshiki.takabayashi@clabs.co>

e2e(js): Loosen error check condition in e2e-test (#380)

Due to possible expansion of the responses error string in potential
proxy setups on a live RPC endpoint, the strict error check in the e2e
viem test caused the test to fail, although the error condition was
expected.

e2e(js): Add test of sending CIP-64 tx with unregistered fee currency in viem e2e test

e2e(js): Run e2e tests on alfajores (#212, #258, #268, #293)

Adds a test of transactions that exceed the max intrinsic gas for a fee
currency, this checks that the transaction fails and the fee currency is
blocked.

This entailed increasing gas limits
for a number of transactions that interact with fee currencies, since
the fee currencies on alfajores are different to our debug ones and also
tests needed to be updated to not rely on hardcoded fee currency rates.

Co-authored-by: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com>

e2e(js): Get extra intrinsic gas for custom fee currency in e2e (#335)

* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 pushed a commit that referenced this pull request Aug 4, 2025
…m test (#43, #55, #293)

Co-authored-by: Pastoh <hbandura@users.noreply.github.com>
Co-authored-by: kourin <yoshiki.takabayashi@clabs.co>

e2e(js): Loosen error check condition in e2e-test (#380)

Due to possible expansion of the responses error string in potential
proxy setups on a live RPC endpoint, the strict error check in the e2e
viem test caused the test to fail, although the error condition was
expected.

e2e(js): Add test of sending CIP-64 tx with unregistered fee currency in viem e2e test

e2e(js): Run e2e tests on alfajores (#212, #258, #268, #293)

Adds a test of transactions that exceed the max intrinsic gas for a fee
currency, this checks that the transaction fails and the fee currency is
blocked.

This entailed increasing gas limits
for a number of transactions that interact with fee currencies, since
the fee currencies on alfajores are different to our debug ones and also
tests needed to be updated to not rely on hardcoded fee currency rates.

Co-authored-by: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com>

e2e(js): Get extra intrinsic gas for custom fee currency in e2e (#335)

* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 pushed a commit that referenced this pull request Aug 4, 2025
…m test (#43, #55, #293)

Co-authored-by: Pastoh <hbandura@users.noreply.github.com>
Co-authored-by: kourin <yoshiki.takabayashi@clabs.co>

e2e(js): Loosen error check condition in e2e-test (#380)

Due to possible expansion of the responses error string in potential
proxy setups on a live RPC endpoint, the strict error check in the e2e
viem test caused the test to fail, although the error condition was
expected.

e2e(js): Add test of sending CIP-64 tx with unregistered fee currency in viem e2e test

e2e(js): Run e2e tests on alfajores (#212, #258, #268, #293)

Adds a test of transactions that exceed the max intrinsic gas for a fee
currency, this checks that the transaction fails and the fee currency is
blocked.

This entailed increasing gas limits
for a number of transactions that interact with fee currencies, since
the fee currencies on alfajores are different to our debug ones and also
tests needed to be updated to not rely on hardcoded fee currency rates.

Co-authored-by: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com>

e2e(js): Get extra intrinsic gas for custom fee currency in e2e (#335)

* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Kourin1996 pushed a commit that referenced this pull request Aug 5, 2025
…m test (#43, #55, #293)

Co-authored-by: Pastoh <hbandura@users.noreply.github.com>
Co-authored-by: kourin <yoshiki.takabayashi@clabs.co>

e2e(js): Loosen error check condition in e2e-test (#380)

Due to possible expansion of the responses error string in potential
proxy setups on a live RPC endpoint, the strict error check in the e2e
viem test caused the test to fail, although the error condition was
expected.

e2e(js): Add test of sending CIP-64 tx with unregistered fee currency in viem e2e test

e2e(js): Run e2e tests on alfajores (#212, #258, #268, #293)

Adds a test of transactions that exceed the max intrinsic gas for a fee
currency, this checks that the transaction fails and the fee currency is
blocked.

This entailed increasing gas limits
for a number of transactions that interact with fee currencies, since
the fee currencies on alfajores are different to our debug ones and also
tests needed to be updated to not rely on hardcoded fee currency rates.

Co-authored-by: Maximilian Langenfeld <15726643+ezdac@users.noreply.github.com>

e2e(js): Get extra intrinsic gas for custom fee currency in e2e (#335)

* Get IntrinsicGas for custom fee currency in e2e

* Rename function name and add comments

* Add missing await

* Fix wrong method call

* Fix codes based reviews
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update e2e tests to dynamically retreive intrinsic gas from fee currency directory

2 participants